پرش به مطلب اصلی

Reseller API

POST /reseller

Description

This API endpoint retrieves information about a reseller based on the provided reseller ID.

Request Body

The request uses GraphQL to perform the reseller query, which requires one variable: id.

Query:

query reseller ($id: Int!) {
reseller (id: $id) {
id
email
firstName
lastName
credit
level
phone
}
}

GraphQL Variables:

{
"id": 0
}

Example Request:

curl --location '' \
--header 'Content-Type: application/json' \
--data '{"query":"query reseller ($id: Int!) {\n reseller (id: $id) {\n id\n email\n firstName\n lastName\n credit\n level\n phone\n }\n}","variables":{"id":0}}'

Parameters

  • id: The unique identifier of the reseller.

Response:

  • Success (200 OK):

    • The response includes the details of the reseller with the specified ID.
    {
    "data": {
    "reseller": {
    "id": 1,
    "email": "reseller@example.com",
    "firstName": "John",
    "lastName": "Doe",
    "credit": 5000,
    "level": "Gold",
    "phone": "+1234567890"
    }
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with the request, such as an invalid ID or server error, the response will include an error message and status code.

Note:

Ensure that the id provided corresponds to an existing reseller. The API returns detailed information including email, name, credit balance, level, and phone number.